//
//  USSponsorSuccessView.m
//  us
//
//  Created by lhx on 2025/6/27.
//

#import "USSponsorSuccessView.h"

@implementation USSponsorSuccessView


- (void)awakeFromNib {
    [super awakeFromNib];
    
    
}

- (void)setSponsorType:(NSInteger)sponsorType {
    for (UIView *subview in self.sponsorBgView.subviews) {
        [subview removeFromSuperview];
    }
 
    NSArray *coderList = @[@[@"Sponsor_404",@"Sponsor_🌼",@"Sponsor_YCC"],@[@"Sponsor_yonico"],@[@"Sponsor_karry",@"Sponsor_梅子"]];
    NSArray *arr = coderList[sponsorType];

    for (int i = 0; i<arr.count; i++) {
        UIImageView *imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:arr[i]]];
        [self.sponsorBgView addSubview:imgView];

        CGFloat center_X = 0.0;
        if (sponsorType == 0) {
            if (i == 0) {
                center_X = -80;
            }else if (i == 1) {
                center_X = 0;
            }else{
                center_X = 80;
            }
        }else if (sponsorType == 1) {
            center_X = 0;
        }else {
            if (i == 0) {
                center_X = -40;
            }else{
                center_X = 40;
            }
        }
        
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(80);
            make.top.mas_equalTo(0);
            make.centerX.mas_equalTo(center_X);
        }];
        
    }
    
}


@end
